/* Copyright (c) 2011 Team A CS2340. All rights reserved.*/

package edu.gatech.teama.doctorsoffice.model;




import org.joda.time.LocalDateTime;

/**
 * Appointment.java - class for patient appointments  
 * @author unknown
 * @version 1.0
 */
public class Appointment extends AbstractModelObject { // $codepro.audit.disable com.instantiations.assist.eclipse.analysis.audit.rule.effectivejava.alwaysOverridetoString.alwaysOverrideToString

	/**
	 * id
	 */
	private String id; // $codepro.audit.disable com.instantiations.assist.eclipse.analysis.unassignedField, unusedField
	
   /**
    * patient username
    */
	private final String patientUsername;
    
	/**
     * date 
     */
	private final LocalDateTime date;

    /**
     * reason
     */
	private final String reason;

	/**
	 * treatment record
	 */
	private TreatmentRecord treatmentRecord; // $codepro.audit.disable com.instantiations.assist.eclipse.analysis.unassignedField
	
    /**
     * Appointment
     * @param patientUsername
     * @param date
     * @param reason
     */
	public Appointment(String patientUsername, LocalDateTime date, String reason) {
		this.date = date;
		this.reason = reason;
		this.patientUsername = patientUsername;
		//this.treatmentRecord =
	}
	
	/**
	 * get treatment record
	 * @return treatment record
	 */
	public TreatmentRecord getTreatmentRecord() {
		if (this.treatmentRecord == null){
			this.treatmentRecord = new TreatmentRecord();
		}
		return this.treatmentRecord;
	}
	
	/**
	 * get id
	 * @return string with date + patientUsername
	 */
	public String getID() {
		return date.toString("MMddyyyyHHmm") + patientUsername;
	}
	
	/**
	 * get date
	 * @return date
	 */
	public LocalDateTime getDate(){
		return this.date;
	}
	
    /**
     * get reason
     * @return reason
     */
	public String getReason() {
		return reason;
	}
	
	/**
	 * get patient username
	 * @return patient username
	 */
	public String getPatientUsername() {
		return patientUsername;
	}
}
